package com.module.sysconfig.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.module.sysconfig.dao.CyyjpzMapper;
import com.module.sysconfig.dao.ZdbMapper;
import com.module.sysconfig.entity.Cyyjpz;
import com.module.sysconfig.entity.Ywlxpz;
import com.module.sysconfig.service.CyyjpzService;
import com.support.cache.annotation.CacheEvict;
import com.support.cache.annotation.Cacheable;
import com.support.cache.annotation.KeyMode;
@Service
public class CyyjpzServiceImpl implements CyyjpzService {
	
	private CyyjpzMapper cyyjpzMapper;
	
	@Autowired
	public void setCyyjpzMapper(CyyjpzMapper cyyjpzMapper) 
	{
		this.cyyjpzMapper = cyyjpzMapper;
	}
	

	/**
	 * 新增常用类型配置数据
	 */
	@CacheEvict(key="ALL_CYYJPZ_RECORD")
	public void saveCyyjpz(Cyyjpz cyyjpz) 
	{
		cyyjpzMapper.saveCyyjpz(cyyjpz);
	}

	/**
	 * 修改常用类型配置数据
	 */
	@CacheEvict(key="ALL_CYYJPZ_RECORD")
	public void updateCyyjpz(Cyyjpz cyyjpz) 
	{
		cyyjpzMapper.updatecyyjpz(cyyjpz);
	}

	/**
	 * 删除常用类型配置数据
	 */
	@CacheEvict(key="ALL_CYYJPZ_RECORD")
	public void deleteCyyjpz(long id) 
	{
		cyyjpzMapper.deleteCyyjpz(id);
	}

	/**
	 * 查询常用类型配置数据
	 */
	@Cacheable(keyMode=KeyMode.KEY_ONLY, key="ALL_CYYJPZ_RECORD")
	public List<Map<String, String>> queryCyyjpz() 
	{
		
		List<Map<String, String>> records = cyyjpzMapper.queryCyyjpz();
		return records;
		
	}

	/**
	 * 按ID查询常用类型配置数据
	 */
	public Cyyjpz queryCyyjpzById(long id) {
		return cyyjpzMapper.queryCyyjpzById(id);
	}

}
